﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CoinDev.Areas.UserAdministration.Models.UserAdministration.IndexViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Roles
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div id="content">
<link href='<% =Url.Content("~/Content/MvcMembership.css") %>' rel="stylesheet" type="text/css" />

    <h1>Roles</h1>
	    <div class="mvcMembership-allRoles">
            <div class="form_settings">

            <% using(Html.BeginForm("CreateRole", "UserAdministration")){ %>
			    <label for="id">Role:</label>
			    <% =Html.TextBox("id") %>
			    <input class="submit" type="submit"  value="Create Role" />
	        <% } %>
            <br />
	        <% if(Model.Roles.Count() > 0 ){ %>
		        <ul>
			        <% foreach(var role in Model.Roles){ %>
			        <li>
				        <span><% =Html.ActionLink(role, "Role", new{id = role}) %></span>
				        <% using(Html.BeginForm("DeleteRole", "UserAdministration", new{id=role})){ %>
				        <input class="submit"  type="submit" value="Delete" />
				        <% } %>
			        </li>
			        <% } %>
		        </ul>
	        <% }else{ %>
		        <p>No roles have been created.</p>
	        <% } %>
	        </div>
        </div>

</div>

</asp:Content>
